<template>
  <div>
    <slot>123</slot>

    <ul>
      <li v-for="v in list" :key="v.id">
        <input type="checkbox" v-model="v.isChecked">
        <span>{{ v.title }}</span>
        <b @click="handleClick(v.id)">X</b>
      </li>
    </ul>
  </div>
</template>


<script>
import { mapMutations } from 'vuex'
export default {
  name: 'List',
  props: {
    list: {
      type: Array,
      require: true
    }
  },
  methods: {
    ...mapMutations(['DELETE_LIST']),
    handleClick(id) {
      // this.$store.commit({
      //   type: 'DELETE_LIST',
      //   id
      // })
      this.DELETE_LIST(id)
    }
  }
}
</script>

<style scoped lang="scss">
ul li  {
  list-style: none;
  display: flex;
}
</style>